<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center shopClassification_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub shopClassification_fd0_0'>
					<view class='flex flex-wrap align-center shopClassification_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2'>&#xe794;</text>
					</view>
					<text class='shopClassification_fd0_0_c1'>分类</text>
					<view class='flex flex-wrap align-center exchangeRecords_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<benben-goods-classify-swiper class='flex  shopClassification_flex_classify_1' :top='88'
				:is-three-level='false' :handle-id.sync='click_aid' :lists='dataList' :left_id="left_id"
				@refresh="queryListFunc()" @handle-item="jumpFunc()" @handle-swiper="goPageFunc($event)">
			</benben-goods-classify-swiper>
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"dataList": [],
				"click_aid": "",
				"left_id": "",
				"aid": "",
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				aid
			} = options
			if (aid !== undefined) this.aid = aid
			if (!this.aid) {
				this.left_id = 0
				console.log(this.left_id, "this.left_id");
			}

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.queryListFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取服务分类
			async queryListFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.get(global.apiUrls.post645c493638fbb, {

				});

				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data
				console.log(this.aid);
				if (this.aid) {
					this.dataList.forEach((item, index) => {
						console.log(item, "item");
						if (item.aid == this.aid) {
							this.left_id = index
							console.log(this.left_id, "this.left_id");
						}
					})
				}
			},
			//跳转
			jumpFunc() {
				this.$urouter.navigateTo(`/pages/newShop/commodityList/commodityList?cid=${this.click_aid}`);
			},
			//动态跳转
			goPageFunc(e) {
				this.dynamicJump(e.href);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.exchangeRecords_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.shopClassification_flex_0 {
		border-bottom: 1px solid #eee;
		background: var(--benbenbgColor-bgPjTitle);
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.shopClassification_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: var(--benbenFontColor-fcPjTitle);
	}

	.shopClassification_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.shopClassification_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	::v-deep .shopClassification_flex_classify_1 {
		--classify-radius: 0rpx;
	}
</style>